package model

import (
	"gorm.io/gorm"
	"time"
)

type UserInfo struct {
	Id                     uint64         `gorm:"column:id;type:int UNSIGNED;primaryKey;not null;" json:"id"`
	UserId                 uint64         `gorm:"column:user_id;type:int UNSIGNED;not null;" json:"user_id"`
	ExamPaperInformationId uint64         `gorm:"column:exam_paper_information_id;type:int UNSIGNED;not null;" json:"exam_paper_information_id"`
	TestQuestion           string         `gorm:"column:test_question;type:varchar(255);comment:试题名称;not null;" json:"test_question"`       // 试题名称
	TestPaperTypes         string         `gorm:"column:test_paper_types;type:varchar(255);comment:试卷类型;not null;" json:"test_paper_types"` // 试卷类型
	Type                   string         `gorm:"column:type;type:varchar(30);comment:考试状态;not null;" json:"type"`                          // 考试状态
	Fraction               uint64         `gorm:"column:fraction;type:int UNSIGNED;comment:分数;not null;" json:"fraction"`                   // 分数
	ExamStatus             string         `gorm:"column:exam_status;type:varchar(10);comment:学员状态;not null;" json:"exam_status"`            // 学员状态
	CreatedAt              time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt              time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt              gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (u *UserInfo) TableName() string {
	return "user_info"
}
